package com.example.controller.file;

import com.example.domain.OSSResult;
import com.example.service.IFileService;
import oj.common.core.controller.BaseController;
import oj.common.core.domain.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping("/file")
public class FileController extends BaseController {
    @Autowired
    private IFileService fileService;
    @PostMapping("/upload")
    public Result<OSSResult> uploadFile(@RequestBody MultipartFile file) {
        return Result.success(fileService.uploadFile(file));
    }
}
